﻿using ReflectionStudio.Core.Events;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using WPFExcelReport.Controls;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
    
    public partial class UIAM
    {
       
        public VAMSTAMM TMV
        {
            get
            {
                if (MV == null) MV = new VAMSTAMM();
                return (VAMSTAMM)MV;
            }
        }
        #region ==IsMonitoring===========
        public static readonly DependencyProperty IsMonitoringProperty = DependencyProperty.Register("IsMonitoring",
        typeof(bool), typeof(UIAM),
        new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsMonitoringChanged));
        public bool IsMonitoring
        {
            get
            {
                return (bool)GetValue(IsMonitoringProperty);
            }
            set
            {
                SetValue(IsMonitoringProperty, value);

            }
        }
        private static void OnIsMonitoringChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.IsMonitoring = (bool)e.NewValue;
                src.OnMonitroing((bool)e.NewValue);
            }
        }
        public virtual void OnMonitroing(bool value)
        {
            StartMonitoring();
        }
        #endregion
        #region ==IsSimulate===========
        public static readonly DependencyProperty IsSimulateProperty = DependencyProperty.Register("IsSimulate",
        typeof(bool), typeof(UIAM),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSimulateChanged));
        public bool IsSimulate
        {
            get
            {
                return (bool)GetValue(IsSimulateProperty);
            }
            set
            {
                SetValue(IsSimulateProperty, value);
               
            }
        }
        private static void OnIsSimulateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.IsSimulate = (bool)e.NewValue;
                src.OnSimulateChg((bool)e.NewValue);
            }
        }
        public virtual void OnSimulateChg(bool value)
        { }
        #endregion
        #region ==IsSTD===========
        public static readonly DependencyProperty IsSTDProperty = DependencyProperty.Register("IsSTD",
        typeof(bool), typeof(UIAM),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSTDChanged));
        public bool IsSTD
        {
            get
            {
                return (bool)GetValue(IsSTDProperty);
            }
            set
            {
                SetValue(IsSTDProperty, value);
                OnSTDChg(value);
            }
        }
        private static void OnIsSTDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.IsSTD = (bool)e.NewValue;
            }
        }
        public virtual void OnSTDChg(bool value)
        { }
        #endregion
        #region ==IsShift===========
        public static readonly DependencyProperty IsShiftProperty = DependencyProperty.Register("IsShift",
        typeof(bool), typeof(UIAM),
        new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsShiftChanged));
        public bool IsShift
        {
            get
            {
                return (bool)GetValue(IsShiftProperty);
            }
            set
            {
                SetValue(IsShiftProperty, value);
                OnIsShiftChg(value);
            }
        }
        private static void OnIsShiftChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.IsShift = (bool)e.NewValue;
            }
        }
        public virtual void OnIsShiftChg(bool value)
        { }
        #endregion

        #region ==IsMachineReady===========
        public static readonly DependencyProperty IsMachineReadyProperty = DependencyProperty.Register("IsMachineReady",
        typeof(bool), typeof(UIAM),
        new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsMachineReadyChanged));
        public bool IsMachineReady
        {
            get
            {
                return (bool)GetValue(IsMachineReadyProperty);
            }
            set
            {
                SetValue(IsMachineReadyProperty, value);
            }
        }
        private static void OnIsMachineReadyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.IsMachineReady = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==dwAM===========
        public static readonly DependencyProperty dwAMProperty = DependencyProperty.Register("dwAM",
            typeof(DataRow), typeof(UIAM),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwAMChanged));
        public DataRow dwAM
        {
            get
            {
                return (DataRow)GetValue(dwAMProperty);
            }
            set
            {
                SetValue(dwAMProperty, value);
            }
        }
        private static void OndwAMChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.dwAM = (DataRow)e.NewValue;
            }
        }
        #endregion

        #region ==KSTKRS===========
        public static readonly DependencyProperty KSTKRSProperty = DependencyProperty.Register("KSTKRS",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKSTKRSChanged));
        public string KSTKRS
        {
            get
            {
                return (string)GetValue(KSTKRSProperty);
            }
            set
            {
                SetValue(KSTKRSProperty, value);
                OnKSTKRSChg(value);
            }
        }
        private static void OnKSTKRSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.KSTKRS = (string)e.NewValue;
            }
        }
        public virtual void OnKSTKRSChg(string value)
        { }
        #endregion
        #region ==KST===========
        public static readonly DependencyProperty KSTProperty = DependencyProperty.Register("KST",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKSTChanged));
        public string KST
        {
            get
            {
                return (string)GetValue(KSTProperty);
            }
            set
            {
                SetValue(KSTProperty, value);
                OnKSTChg(value);
            }
        }
        private static void OnKSTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.KST = (string)e.NewValue;
            }
        }
        public virtual void OnKSTChg(string value)
        { }
        #endregion

        #region ==WD===========
        public static readonly DependencyProperty WDProperty = DependencyProperty.Register("WD",
            typeof(int), typeof(UIAM),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWDChanged));
        public int WD
        {
            get
            {
                return (int)GetValue(WDProperty);
            }
            set
            {
                SetValue(WDProperty, value);
                OnWDChg();
            }
        }
        private static void OnWDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.WD = (int)e.NewValue;
            }
        }
        public virtual void OnWDChg()
        {
            if (TMV == null)
                return;
            TMV.WD = WD;
        }
        #endregion

        #region ==MACHINEID===========
        public static readonly DependencyProperty MACHINEIDProperty = DependencyProperty.Register("MACHINEID",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMACHINEIDChanged));
        public string MACHINEID
        {
            get
            {
                return (string)GetValue(MACHINEIDProperty);
            }
            set
            {
                SetValue(MACHINEIDProperty, value);
            }
        }
        private static void OnMACHINEIDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.MACHINEID = (string)e.NewValue;
            }
        }
        #endregion

        #region ==MJQTY===========
        public static readonly DependencyProperty MJQTYProperty = DependencyProperty.Register("MJQTY",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMJQTYChanged));
        public string MJQTY
        {
            get
            {
                return (string)GetValue(MJQTYProperty);
            }
            set
            {
                SetValue(MJQTYProperty, value);
            }
        }
        private static void OnMJQTYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.MJQTY = (string)e.NewValue;
            }
        }
        #endregion

        #region ==MJNUM===========
        public static readonly DependencyProperty MJNUMProperty = DependencyProperty.Register("MJNUM",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMJNUMChanged));
        public string MJNUM
        {
            get
            {
                return (string)GetValue(MJNUMProperty);
            }
            set
            {
                SetValue(MJNUMProperty, value);
            }
        }
        private static void OnMJNUMChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.MJNUM = (string)e.NewValue;
            }
        }
        #endregion


        #region ==MLFD===========
        public static readonly DependencyProperty MLFDProperty = DependencyProperty.Register("MLFD",
            typeof(int), typeof(UIAM),
            new FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMLFDChanged));
        public int MLFD
        {
            get
            {
                return (int)GetValue(MLFDProperty);
            }
            set
            {
                SetValue(MLFDProperty, value);
            }
        }
        private static void OnMLFDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.MLFD = (int)e.NewValue;
            }
        }
        #endregion
        #region ==MPOS===========
        public static readonly DependencyProperty MPOSProperty = DependencyProperty.Register("MPOS",
            typeof(int), typeof(UIAM),
            new FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMPOSChanged));
        public int MPOS
        {
            get
            {
                return (int)GetValue(MPOSProperty);
            }
            set
            {
                SetValue(MPOSProperty, value);
            }
        }
        private static void OnMPOSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.MPOS = (int)e.NewValue;
            }
        }
        #endregion


        #region ==AMTYP===========
        public static readonly DependencyProperty AMTYPProperty = DependencyProperty.Register("AMTYP",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAMTYPChanged));
        public string AMTYP
        {
            get
            {
                return (string)GetValue(AMTYPProperty);
            }
            set
            {
                SetValue(AMTYPProperty, value);
                OnAMTYPChg(value);
            }
        }
        private static void OnAMTYPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.AMTYP = (string)e.NewValue;
            }
        }

        public virtual void OnAMTYPChg(string value)
        { }
        #endregion 

        #region ==AMART===========
        public static readonly DependencyProperty AMARTProperty = DependencyProperty.Register("AMART",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAMARTChanged));
        public string AMART
        {
            get
            {
                return (string)GetValue(AMARTProperty);
            }
            set
            {
                SetValue(AMARTProperty, value);
                OnAMARTChg(value);
            }
        }
        private static void OnAMARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.AMART = (string)e.NewValue;
            }
        }
        public virtual void OnAMARTChg(string value)
        { }
        #endregion

        #region ==LIEFNR===========
        public static readonly DependencyProperty LIEFNRProperty = DependencyProperty.Register("LIEFNR",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLIEFNRChanged));
        public string LIEFNR
        {
            get
            {
                return (string)GetValue(LIEFNRProperty);
            }
            set
            {
                SetValue(LIEFNRProperty, value);
                OnLIEFNRChg(value);
            }
        }
        private static void OnLIEFNRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.LIEFNR = (string)e.NewValue;
            }
        }
        public virtual void OnLIEFNRChg(string value)
        { }
        #endregion

        #region ==AMKST===========
        public static readonly DependencyProperty AMKSTProperty = DependencyProperty.Register("AMKST",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAMKSTChanged));
        public string AMKST
        {
            get
            {
                return (string)GetValue(AMKSTProperty);
            }
            set
            {
                SetValue(AMKSTProperty, value);
               
            }
        }
        private static void OnAMKSTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.AMKST = (string)e.NewValue;
                src.OnAMKSTChg((string)e.NewValue);
            }
        }
        public virtual void OnAMKSTChg(string value)
        { }
        #endregion

        #region ==AMCD===========
        public static readonly DependencyProperty AMCDProperty = DependencyProperty.Register("AMCD",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAMCDChanged));
        public string AMCD
        {
            get
            {
                return (string)GetValue(AMCDProperty);
            }
            set
            {
                SetValue(AMCDProperty, value);
                OnAMCDChg(value);
            }
        }
        private static void OnAMCDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.AMCD = (string)e.NewValue;
            }
        }
        public virtual void OnAMCDChg(string value)
        { }
        #endregion

        #region ==AMBDEMA===========
        public static readonly DependencyProperty AMBDEMAProperty = DependencyProperty.Register("AMBDEMA",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAMBDEMAChanged));
        public string AMBDEMA
        {
            get
            {
                return (string)GetValue(AMBDEMAProperty);
            }
            set
            {
                SetValue(AMBDEMAProperty, value);
                OnAMBDEMAChg(value);
            }
        }
        private static void OnAMBDEMAChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.AMBDEMA = (string)e.NewValue;
            }
        }
        public virtual void OnAMBDEMAChg(string value)
        { }
        #endregion

        #region ==VU0===========
        public static readonly DependencyProperty VU0Property = DependencyProperty.Register("VU0",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU0Changed));
        public string VU0
        {
            get
            {
                return (string)GetValue(VU0Property);
            }
            set
            {
                SetValue(VU0Property, value);
                
            }
        }
        private static void OnVU0Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU0 = (string)e.NewValue;
                src.OnVU0Chg((string)e.NewValue);
            }
        }
        public virtual void OnVU0Chg(string value)
        { }
        #endregion
        #region ==VU1===========
        public static readonly DependencyProperty VU1Property = DependencyProperty.Register("VU1",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU1Changed));
        public string VU1
        {
            get
            {
                return (string)GetValue(VU1Property);
            }
            set
            {
                SetValue(VU1Property, value);
                OnVU1Chg(value);
            }
        }
        private static void OnVU1Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU1 = (string)e.NewValue;
            }
        }
        public virtual void OnVU1Chg(string value)
        { }
        #endregion
        #region ==VU2===========
        public static readonly DependencyProperty VU2Property = DependencyProperty.Register("VU2",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU2Changed));
        public string VU2
        {
            get
            {
                return (string)GetValue(VU2Property);
            }
            set
            {
                SetValue(VU2Property, value);
                OnVU2Chg(value);
            }
        }
        private static void OnVU2Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU2 = (string)e.NewValue;
            }
        }
        public virtual void OnVU2Chg(string value)
        { }
        #endregion
        #region ==VU3===========
        public static readonly DependencyProperty VU3Property = DependencyProperty.Register("VU3",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU3Changed));
        public string VU3
        {
            get
            {
                return (string)GetValue(VU3Property);
            }
            set
            {
                SetValue(VU3Property, value);
                OnVU3Chg(value);
            }
        }
        private static void OnVU3Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU3 = (string)e.NewValue;
            }
        }
        public virtual void OnVU3Chg(string value)
        { }
        #endregion
        #region ==VU4===========
        public static readonly DependencyProperty VU4Property = DependencyProperty.Register("VU4",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU4Changed));
        public string VU4
        {
            get
            {
                return (string)GetValue(VU4Property);
            }
            set
            {
                SetValue(VU4Property, value);
                OnVU4Chg(value);
            }
        }
        private static void OnVU4Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU4 = (string)e.NewValue;
            }
        }
        public virtual void OnVU4Chg(string value)
        { }
        #endregion
        #region ==VU5===========
        public static readonly DependencyProperty VU5Property = DependencyProperty.Register("VU5",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU5Changed));
        public string VU5
        {
            get
            {
                return (string)GetValue(VU5Property);
            }
            set
            {
                SetValue(VU5Property, value);
                OnVU5Chg(value);
            }
        }
        private static void OnVU5Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU5 = (string)e.NewValue;
            }
        }
        public virtual void OnVU5Chg(string value)
        { }
        #endregion
        #region ==VU6===========
        public static readonly DependencyProperty VU6Property = DependencyProperty.Register("VU6",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU6Changed));
        public string VU6
        {
            get
            {
                return (string)GetValue(VU6Property);
            }
            set
            {
                SetValue(VU6Property, value);
                OnVU6Chg(value);
            }
        }
        private static void OnVU6Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU6 = (string)e.NewValue;
            }
        }
        public virtual void OnVU6Chg(string value)
        { }
        #endregion
        #region ==VU7===========
        public static readonly DependencyProperty VU7Property = DependencyProperty.Register("VU7",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU7Changed));
        public string VU7
        {
            get
            {
                return (string)GetValue(VU7Property);
            }
            set
            {
                SetValue(VU7Property, value);
                OnVU7Chg(value);
            }
        }
        private static void OnVU7Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU7 = (string)e.NewValue;
            }
        }
        public virtual void OnVU7Chg(string value)
        { }
        #endregion
        #region ==VU8===========
        public static readonly DependencyProperty VU8Property = DependencyProperty.Register("VU8",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU8Changed));
        public string VU8
        {
            get
            {
                return (string)GetValue(VU8Property);
            }
            set
            {
                SetValue(VU8Property, value);
                OnVU8Chg(value);
            }
        }
        private static void OnVU8Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU8 = (string)e.NewValue;
            }
        }
        public virtual void OnVU8Chg(string value)
        { }
        #endregion
        #region ==VU9===========
        public static readonly DependencyProperty VU9Property = DependencyProperty.Register("VU9",
            typeof(string), typeof(UIAM),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVU9Changed));
        public string VU9
        {
            get
            {
                return (string)GetValue(VU9Property);
            }
            set
            {
                SetValue(VU9Property, value);
                OnVU9Chg(value);
            }
        }
        private static void OnVU9Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIAM;
            if (src != null)
            {
                src.VU9 = (string)e.NewValue;
            }
        }
        public virtual void OnVU9Chg(string value)
        { }
        #endregion
    }
}
